package com.jerry.base.dynamicproxy;

/**
 * 业务逻辑
 *
 * @author Jerry
 * @since 2024/7/17 15:07
 */
public class UserServiceImpl implements UserService {

    public void login() throws InterruptedException {
        long start = System.currentTimeMillis();

        // 具体的业务逻辑，这里模拟耗时
        Thread.sleep(1000);

        long end = System.currentTimeMillis();
        System.out.println("执行login耗时：" + (end - start) + "ms");
    }

    public void userInfo() throws InterruptedException {
        long start = System.currentTimeMillis();

        // 具体的业务逻辑，这里模拟耗时
        Thread.sleep(500);

        long end = System.currentTimeMillis();
        System.out.println("执行userInfo耗时：" + (end - start) + "ms");
    }

    public void updateUser() throws InterruptedException {
        long start = System.currentTimeMillis();

        // 具体的业务逻辑，这里模拟耗时
        Thread.sleep(1500);

        long end = System.currentTimeMillis();
        System.out.println("执行updateUser耗时：" + (end - start) + "ms");
    }
}
